import {defineTests} from '../craftTestUtils';

export default defineTests([

  {
    'name': 'Smoke0',
    'state': {
      'sketches': {
        '1:5': {'Segment': [[[38, 48], [-159, 48]], [[-159, 48], [-159, 261]], [[-159, 261], [38, 261]], [[38, 261], [38, 48]]]},
        '0:0': {'Segment': [[[-12, 326], [-293, 148]], [[-293, 148], [-38, 9]], [[-38, 9], [332, 110]], [[332, 110], [-12, 326]]]}
      },
      'operations': [{
        'type': 'PLANE',
        'params': {'orientation': 'XY', 'parallelTo': '', 'depth': 0}
      }, {
        'type': 'EXTRUDE',
        'params': {'value': 112, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '0:0'}
      }, {'type': 'CUT', 'params': {'value': 50, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '1:5'}}]
    },
    'expected': {
      'format': 'LOOPS',
      'vertices': [[-293, 148, 0], [-293, 148, 112], [-159, 233, 62], [-159, 75, 62], [-159, 75, 112], [-159, 233, 112], [-115, 261, 112], [-115, 261, 62], [-110, 48, 112], [-110, 48, 62], [-38, 9, 0], [-38, 9, 112], [-12, 326, 0], [-12, 326, 112], [38, 48, 62], [38, 48, 112], [38, 261, 62], [38, 261, 112], [332, 110, 0], [332, 110, 112]],
      'faces': [[[19, 18, 12, 13]], [[11, 10, 18, 19]], [[9, 3, 4, 1, 0, 10, 11, 8]], [[2, 7, 6, 13, 12, 0, 1, 5]], [[0, 12, 18, 10]], [[15, 17, 16, 14]], [[6, 7, 16, 17]], [[2, 5, 4, 3]], [[9, 8, 15, 14]], [[7, 2, 3, 9, 14, 16]], [[4, 5, 1]], [[6, 17, 15, 8, 11, 19, 13]]]
    }
  },
  {
    'name': 'Smoke1',
    'state': {
      'sketches': {
        '3:5': {'Segment': [[[-70, 210], [82, 210]], [[82, 210], [82, -160]], [[82, -160], [-70, -160]], [[-70, -160], [-70, 210]]]},
        '1:5': {'Segment': [[[-107, 53], [140, 53]], [[140, 53], [140, -155]], [[140, -155], [-107, -155]], [[-107, -155], [-107, 53]]]},
        '0:5': {'Segment': [[[-220, 212], [60, 212]], [[60, 212], [60, -73]], [[60, -73], [-220, -73]], [[-220, -73], [-220, 212]]]},
        '0:3': {'Segment': [[[250, 250], [17, 250]], [[17, 250], [17, 13]], [[17, 13], [250, 13]], [[250, 13], [250, 250]]]},
        '0:1': {'Segment': [[[44, 188], [155, 188]], [[155, 188], [155, 42]], [[155, 42], [44, 42]], [[44, 42], [44, 188]]]},
        '0:0': {'Segment': [[[107, -49], [-120, -49]], [[-120, -49], [-120, 172]], [[-120, 172], [107, 172]], [[107, 172], [107, -49]]]}
      },
      'operations': [{'type': 'BOX', 'params': {'width': 500, 'height': 500, 'depth': 500}}, {
        'type': 'EXTRUDE',
        'params': {'value': 50, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '0:3'}
      }, {
        'type': 'EXTRUDE',
        'params': {'value': 50, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '1:5'}
      }, {
        'type': 'CUT',
        'params': {'value': 500, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '0:0'}
      }, {
        'type': 'CUT',
        'params': {'value': 600, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '0:5'}
      }, {'type': 'CUT', 'params': {'value': 50, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '0:1'}}, {
        'type': 'CUT',
        'params': {'value': 50, 'prism': 1, 'angle': 0, 'rotation': 0, 'face': '3:5'}
      }]
    },
    'expected': {
      'format': 'LOOPS',
      'vertices': [[-300, 13, 17], [-300, 13, 250], [-300, 250, 17], [-300, 250, 250], [-250, -250, -250], [-250, -250, 250], [-250, 13, 17], [-250, 13, 250], [-250, 250, -250], [-250, 250, 17], [-250, 250, 250], [-120, -250, -49], [-120, -250, 172], [-120, 250, -49], [-120, 250, 172], [-107, -155, 250], [-107, -155, 300], [-107, 53, 250], [-107, 53, 300], [-82, 200, -160], [-82, 200, -49], [-82, 200, 172], [-82, 200, 210], [-82, 250, -160], [-82, 250, -49], [-82, 250, 172], [-82, 250, 210], [-60, 200, 172], [-60, -73, -250], [-60, -73, -49], [-60, -73, 172], [-60, -73, 300], [-60, 53, 250], [-60, 53, 300], [-60, 200, -160], [-60, 200, 210], [-60, 212, -250], [-60, 212, -160], [-60, 212, 210], [-60, 212, 250], [-60, 200, -49], [70, 212, -160], [70, 212, 172], [70, 212, 210], [70, 250, -160], [70, 250, -49], [70, 250, 172], [70, 250, 210], [70, 212, -49], [107, -250, -49], [107, -250, 172], [107, -73, 172], [107, -73, -49], [107, 212, -49], [107, 212, 172], [107, 250, -49], [107, 250, 172], [140, -155, 250], [140, -155, 300], [140, -73, 250], [140, -73, 300], [220, -73, -250], [220, -73, 250], [220, 42, -155], [220, 42, -44], [220, 188, -155], [220, 188, -44], [220, 212, -250], [220, 212, 250], [250, -250, -250], [250, -250, 250], [250, 42, -155], [250, 42, -44], [250, 188, -155], [250, 188, -44], [250, 250, -250], [250, 250, 250]],
      'faces': [[[1, 0, 6, 7]], [[0, 2, 9, 6]], [[0, 1, 3, 2]], [[6, 9, 8, 4, 5, 7]], [[17, 18, 33, 32]], [[58, 57, 59, 60]], [[16, 15, 57, 58]], [[18, 17, 15, 16]], [[58, 60, 31, 33, 18, 16]], [[5, 70, 76, 10, 3, 1, 7], [17, 32, 39, 68, 62, 59, 57, 15]], [[56, 55, 53, 54]], [[49, 50, 51, 52]], [[21, 27, 30, 51, 50, 12, 14, 25]], [[42, 46, 56, 54]], [[11, 13, 14, 12]], [[40, 20, 24, 13, 11, 49, 52, 29]], [[45, 48, 53, 55]], [[5, 4, 69, 70], [50, 49, 11, 12]], [[67, 61, 62, 68], [63, 65, 66, 64]], [[61, 28, 29, 52, 51, 30, 31, 60, 59, 62]], [[34, 40, 29, 28, 36, 37]], [[27, 35, 38, 39, 32, 33, 31, 30]], [[38, 43, 42, 54, 53, 48, 41, 37, 36, 67, 68, 39]], [[8, 75, 69, 4], [67, 36, 28, 61]], [[72, 64, 66, 74]], [[71, 63, 64, 72]], [[73, 65, 63, 71]], [[74, 66, 65, 73]], [[70, 69, 75, 76], [73, 71, 72, 74]], [[41, 48, 45, 44]], [[42, 43, 47, 46]], [[37, 41, 44, 23, 19, 34]], [[24, 20, 19, 23]], [[21, 25, 26, 22]], [[43, 38, 35, 22, 26, 47]], [[35, 27, 21, 22]], [[40, 34, 19, 20]], [[9, 2, 3, 10, 76, 75, 8], [46, 47, 26, 25, 14, 13, 24, 23, 44, 45, 55, 56]]]
    }
  }

]);  

